Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

TIMES(x, plus(y, 1)) → PLUS(times(x, plus(y, times(1, 0))), x)
TIMES(x, plus(y, 1)) → PLUS(y, times(1, 0))
PLUS(id(x), s(y)) → GT(s(y), y)
PLUS(s(x), x) → IF(gt(x, x), id(x), id(x))
GT(s(x), s(y)) → GT(x, y)
PLUS(s(x), s(y)) → IF(not(gt(x, y)), id(x), id(y))
PLUS(s(x), s(y)) → NOT(gt(x, y))
PLUS(s(x), x) → GT(x, x)
PLUS(s(x), x) → ID(x)
PLUS(s(x), s(y)) → ID(y)
PLUS(s(x), x) → PLUS(if(gt(x, x), id(x), id(x)), s(x))
PLUS(s(x), s(y)) → GT(x, y)
TIMES(x, plus(y, 1)) → TIMES(x, plus(y, times(1, 0)))
TIMES(x, plus(y, 1)) → TIMES(1, 0)
PLUS(s(x), s(y)) → PLUS(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))
NOT(x) → IF(x, false, true)
PLUS(s(x), s(y)) → ID(x)
PLUS(id(x), s(y)) → PLUS(x, if(gt(s(y), y), y, s(y)))
PLUS(id(x), s(y)) → IF(gt(s(y), y), y, s(y))
PLUS(s(x), s(y)) → IF(gt(x, y), x, y)

The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

TIMES(x, plus(y, 1)) → PLUS(times(x, plus(y, times(1, 0))), x)
TIMES(x, plus(y, 1)) → PLUS(y, times(1, 0))
PLUS(id(x), s(y)) → GT(s(y), y)
PLUS(s(x), x) → IF(gt(x, x), id(x), id(x))
GT(s(x), s(y)) → GT(x, y)
PLUS(s(x), s(y)) → IF(not(gt(x, y)), id(x), id(y))
PLUS(s(x), s(y)) → NOT(gt(x, y))
PLUS(s(x), x) → GT(x, x)
PLUS(s(x), x) → ID(x)
PLUS(s(x), s(y)) → ID(y)
PLUS(s(x), x) → PLUS(if(gt(x, x), id(x), id(x)), s(x))
PLUS(s(x), s(y)) → GT(x, y)
TIMES(x, plus(y, 1)) → TIMES(x, plus(y, times(1, 0)))
TIMES(x, plus(y, 1)) → TIMES(1, 0)
PLUS(s(x), s(y)) → PLUS(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))
NOT(x) → IF(x, false, true)
PLUS(s(x), s(y)) → ID(x)
PLUS(id(x), s(y)) → PLUS(x, if(gt(s(y), y), y, s(y)))
PLUS(id(x), s(y)) → IF(gt(s(y), y), y, s(y))
PLUS(s(x), s(y)) → IF(gt(x, y), x, y)

The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 3 SCCs with 15 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

GT(s(x), s(y)) → GT(x, y)

The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

GT(s(x), s(y)) → GT(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ QDPOrderProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

PLUS(s(x), s(y)) → PLUS(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))
PLUS(id(x), s(y)) → PLUS(x, if(gt(s(y), y), y, s(y)))
PLUS(s(x), x) → PLUS(if(gt(x, x), id(x), id(x)), s(x))

The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


PLUS(s(x), s(y)) → PLUS(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))
The remaining pairs can at least be oriented weakly.

PLUS(id(x), s(y)) → PLUS(x, if(gt(s(y), y), y, s(y)))
PLUS(s(x), x) → PLUS(if(gt(x, x), id(x), id(x)), s(x))
Used ordering: Polynomial interpretation with max and min functions [25]:

POL(PLUS(x1, x2)) = max(x1, x2)   
POL(false) = 0   
POL(gt(x1, x2)) = 0   
POL(id(x1)) = x1   
POL(if(x1, x2, x3)) = max(x2, x3)   
POL(not(x1)) = 0   
POL(s(x1)) = 1 + x1   
POL(true) = 0   
POL(zero) = 0   

The following usable rules [17] were oriented:

id(x) → x
if(true, x, y) → x
if(false, x, y) → y



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ QDPOrderProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

PLUS(id(x), s(y)) → PLUS(x, if(gt(s(y), y), y, s(y)))
PLUS(s(x), x) → PLUS(if(gt(x, x), id(x), id(x)), s(x))

The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


PLUS(id(x), s(y)) → PLUS(x, if(gt(s(y), y), y, s(y)))
PLUS(s(x), x) → PLUS(if(gt(x, x), id(x), id(x)), s(x))
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
PLUS(x1, x2)  =  PLUS(x1, x2)
id(x1)  =  id(x1)
s(x1)  =  s(x1)
if(x1, x2, x3)  =  if(x1, x2, x3)
gt(x1, x2)  =  gt
zero  =  zero
false  =  false
true  =  true

Recursive path order with status [2].
Quasi-Precedence:
s1 > [PLUS2, id1] > if3 > false
s1 > [PLUS2, id1] > gt > [zero, true] > false

Status:
PLUS2: [1,2]
if3: multiset
zero: multiset
gt: multiset
true: multiset
false: multiset
s1: multiset
id1: multiset


The following usable rules [17] were oriented:

gt(s(x), s(y)) → gt(x, y)
gt(zero, y) → false
id(x) → x
gt(s(x), zero) → true
if(true, x, y) → x
if(false, x, y) → y



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
QDP
                    ↳ PisEmptyProof
          ↳ QDP

Q DP problem:
P is empty.
The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
QDP
            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

TIMES(x, plus(y, 1)) → TIMES(x, plus(y, times(1, 0)))

The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


TIMES(x, plus(y, 1)) → TIMES(x, plus(y, times(1, 0)))
The remaining pairs can at least be oriented weakly.
none
Used ordering: Polynomial interpretation with max and min functions [25]:

POL(0) = 0   
POL(1) = 1   
POL(TIMES(x1, x2)) = x2   
POL(false) = 0   
POL(gt(x1, x2)) = 0   
POL(id(x1)) = x1   
POL(if(x1, x2, x3)) = 1 + x2 + max(x2, x3)   
POL(not(x1)) = 1 + x1   
POL(plus(x1, x2)) = x2   
POL(s(x1)) = 0   
POL(times(x1, x2)) = 0   
POL(true) = 0   
POL(zero) = 0   

The following usable rules [17] were oriented:

times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ PisEmptyProof

Q DP problem:
P is empty.
The TRS R consists of the following rules:

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.